Completed
Pull Request — master (#21)
by
unknown
02:20
created

reference.js ➔ getFiles   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
nc 1
dl 0
loc 20
rs 9.4285
c 1
b 0
f 0
cc 1
nop 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A reference.js ➔ ... ➔ arr.forEach 0 6 1
1
import path from 'path'
2
import mkdirp from 'mkdirp'
3
import fse from 'fs-extra'
4
5
import {
6
  abeExtend,
0 ignored issues
show
Unused Code introduced by
The variable abeExtend seems to be never used. Consider removing it.
Loading history...
7
  coreUtils,
0 ignored issues
show
Unused Code introduced by
The variable coreUtils seems to be never used. Consider removing it.
Loading history...
8
  cmsData,
9
  config
10
} from '../../'
11
12
export function getFiles() {
13
  var arr = []
0 ignored issues
show
Unused Code introduced by
The assignment to variable arr seems to be never used. Consider removing it.
Loading history...
14
  var res = []
15
  arr = cmsData.file.read(
16
    path.join(config.root, config.reference.url),
17
    path.join(config.root, config.reference.url),
18
    'files',
19
    true,
20
    /(.json*?)/
21
  )
22
23
  arr.forEach(function (el) {
24
    res.push({
25
      name: el.name,
26
      data: cmsData.file.get(el.path)
27
    })
28
  })
29
30
  return res
31
}
32